package com.security.admin.model;

import lombok.Data;
import lombok.ToString;

import java.time.LocalDateTime;

/**
 * @Author yanggld
 * @Date 2020/3/11-18:37
 */
@ToString
@Data
public class TokenInfo {
    private String access_token;
    private String refresh_token;
    private String token_type;
    private Long expires_in;
    private String scope;

    private LocalDateTime expireTime;

    public void init(){
        expireTime = LocalDateTime.now().plusSeconds(expires_in);
    }

    public boolean isExpired(){
        return expireTime.isBefore(LocalDateTime.now());
    }
}
